<?php include("includes/session.php"); ?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><?php echo $lang['PAGE_TITLE_HOMEPAGE']; ?></title>
   <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=<?php echo GOOGLE_KEY; ?>"
		type="text/javascript">
	</script>
    <script type="text/javascript">
    function initialize() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(0, 0), 0);
		map.setUIToDefault();
        map.setMapType(G_SATELLITE_MAP);
		var points = Array(<?=$database->getAllLocationsWithNames(); ?>);
		for (var i = 0; i < points.length; i ++)
		{
			var marker = new GMarker(new GLatLng(points[i][0], points[i][1]));
		//document.getElementById("map_name").innerHTML = "lol";
	  		var self = this;
			GEvent.addListener(marker,"mouseover",
				new Function("document.getElementById(\"map_name\").innerHTML = \""+points[i][2]+"\";"));
			GEvent.addListener(marker,"click",
				new Function("window.location = \"profile.php?user="+points[i][2]+"\";"));
			map.addOverlay(marker);
		}
		//echo "map.addOverlay(new GMarker(new GLatLng($location)));\n";
		";";";";//GEvent.addListener(map,"click", function(overlay, latlng) {
      }
    }
    </script>
<?php include("header.php"); ?>
	<center>
	<table cellpadding="0" cellspacing="0" width="93%">
	<tr>
		<td align="right" valign="top">
		<br />
		<table cellpadding="0" cellspacing="0" width="100%">
		<tr>
			<td colspan="3" valign="top">
				<table cellpadding="10" cellspacing="0" width="100%" class="border">
				<tr><td class="title" align="left"><?php echo $lang['PAGE_HOMEPAGE_INFO']; ?></td></tr>
				<tr>
					<td align="left">
					<?php if($session->logged_in)
					{
					?>
					<center><h3><?php echo $lang['HELLO']; ?> <?php if(strcmp($session->userinfo['fname'],"")==0){ echo $session->username; }else{ echo $session->userinfo['fname']; } ?><?php echo $lang['WELCOME_LOGIN']; ?></h3>
					<table cellpadding="10" cellspacing="0">
					<tr>
						<td width="50%" valign="top">
						<ul>
							<li><a href="wikipt.php"><?php echo $lang['PAGE_HOMEPAGE_EDITWIKI']; ?></a> - <?php echo $lang['PAGE_HOMEPAGE_EDITWIKI_DESC']; ?></li>
							<li><a href="editProfile.php"><?php echo $lang['PROFILE_EDIT']; ?></a> - <?php echo $lang['PROFILE_EDIT_DESC']; ?></li>
							<li><a href="editResources.php"><?php echo $lang['PROFILE_RESOURCES']; ?></a> - <?php echo $lang['PROFILE_RESOURCES_DESC']; ?></li>
							<li><a href="editProjects.php"><?php echo $lang['PROFILE_PROJECTS']; ?></a> - <?php echo $lang['PROFILE_PROJECTS_DESC']; ?></li>
							<li><a href="editLinks.php"><?php echo $lang['PROFILE_LINKS']; ?></a> - <?php echo $lang['PROFILE_LINKS_DESC']; ?></li>
						</ul>
						</td>
						<td width="50%" valign="top">
						<ul>

							<li><a href="wikitransition.php"><?php echo $lang['WIKI_TRANSITION']; ?></a> - <?php echo $lang['WIKI_TRANSITION_DESC']; ?></li>
							<li><a href="wikitec.php"><?php echo $lang['WIKI_TECHNOLOGY']; ?></a> - <?php echo $lang['WIKI_TECHNOLOGY_DESC']; ?></li>
							<li><a href="wikiresources.php"><?php echo $lang['WIKI_RESOURCES']; ?></a> - <?php echo $lang['WIKI_RESOURCES_DESC']; ?></li>
							<li><a href="resources.php"><?php echo $lang['FIND_RESOURCES']; ?></a> - <?php echo $lang['FIND_RESOURCES_DESC']; ?></li>
							<li><a href="projects.php"><?php echo $lang['FIND_PROJECTS']; ?></a> - <?php echo $lang['FIND_PROJECTS_DESC']; ?></li>
							<li><a href="links.php"><?php echo $lang['FIND_LINKS']; ?></a> - <?php echo $lang['FIND_LINKS_DESC']; ?></li>
						</ul>
						<center>
						<!-- AddThis Button BEGIN -->
						<a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&amp;pub=xa-4ab5c796240d2cb0"><img src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a><script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js?pub=xa-4ab5c796240d2cb0"></script>
						<!-- AddThis Button END -->
						</center>
						</td>
					</tr>
					</table>
					</center>
					<?php
					}
					else
					{
					?>
					<center>
					<font size="+1"><b><?php echo $lang['WELCOME']; ?></b></font></center>
					<br /><left>
					<?php echo $lang['WELCOME_MESSAGE']; ?>
					&nbsp;&nbsp;&nbsp;
					<!-- AddThis Button BEGIN -->
					<a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&amp;pub=xa-4ab5c796240d2cb0"><img src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a><script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js?pub=xa-4ab5c796240d2cb0"></script>
					<!-- AddThis Button END -->
					</left>
					<?php
					}
					?>
					</td>
				</tr>
				</table>
				<br />
			</td>
		</tr>
		<tr>
			<td valign="top">
				<table cellpadding="10" cellspacing="0" width="100%" class="border">
				<tr><td class="title" align="left"><?php echo $lang['NEWS_PROJECTS']; ?></td></tr>
				<tr>
					<td><center><?php displayLatestProjectNews(5); ?></center></td>
				</tr>
				</table>
				<br />
				<table cellpadding="10" cellspacing="0" width="100%" class="border">
				<tr><td class="title" align="left"><?php echo $lang['NEWS_RBEPOD']; ?></td></tr>
				<tr>
					<td align="left">
					<?php displayNews(10); ?>
					</td>
				</tr>
				</table>
			</td>
			<td width="20px"></td>
			<td align="right" valign="top">
				<?php
				if(!$session->logged_in)
				{
				?>
				<table cellpadding="10" cellspacing="0" width="100%" class="border">
				<tr><td class="title" align="left"><?php if(!$session->logged_in){ echo "Log In"; }else{ echo "Community"; } ?></td></tr>
				<tr>
					<td><?php include("login.php"); ?></td>
				</tr>
				</table>
				<br />
				<?php
				}
				?>
				<table cellpadding="10" cellspacing="0" width="100%" class="border">
				<tr><td class="title" align="left"><?php echo $lang['COMMUNITY_STATS']; ?></td></tr>
				<tr>
					<td>
					<center>
					<table cellpadding="3" cellspacing="0" width="230px">
					<tr>
						<td><center><b><?php echo $lang['TOTAL_RESOURCES']; ?></b></center></td>
						<td width="20%"><? echo $database->getNumResources(); ?></td>
					</tr>
					<tr>
						<td><center><b><?php echo $lang['TOTAL_PROJECTS']; ?></b></center></td>
						<td width="20%"><? echo $database->getNumProjects(); ?></td>
					</tr>
					<tr>
						<td><center><b><?php echo $lang['TOTAL_MEMBERS']; ?></b></center></td>
						<td><? echo $database->getNumMembers(); ?></td>
					</tr>
					<tr>
						<td><center><b><?php echo $lang['TOTAL_GUESTS_ONLINE']; ?></b></center></td>
						<td><? echo $database->num_active_guests; ?></td>
					</tr>
					<tr>
						<td><center><b><?php echo $lang['TOTAL_MEMBERS_ONLINE']; ?></b></center></td>
						<td><? echo $database->num_active_users; ?></td>
					</tr>
					</table>
					</center>
					</td>
				</tr>
				</table>
				<br />
				<table cellpadding="10" cellspacing="0" width="100%" class="border">
				<tr><td class="title" align="left" onmouseover="if(document.getElementById('map').style.display=='none'){ this.setAttribute('class', 'none'); this.innerHTML='Click To View World Map'; document.body.style.cursor='pointer'; }" onmouseout="this.setAttribute('class', 'title'); this.innerHTML='Location Stats'; document.body.style.cursor='auto';" onclick="if(document.getElementById('map').style.display=='none'){ document.getElementById('map').style.display='inline'; initialize(); this.setAttribute('class', 'title'); this.innerHTML='Location Stats'; document.body.style.cursor='auto'; }">Location Stats</td></tr>
				<tr>
					<td id="map" style="display:all">
					<center>
					<table cellpadding="3" cellspacing="0" width="230px">
					<tr>
						<td>
						<div id="map_canvas" style="width: 300px; height: 220px"></div>
						</td>
					</tr>
					<tr>
						<td>
						<Center><b><div id="map_name"></div></b></Center>
						</td>
					</tr>
					</table>
					</center>
					</td>
				</tr>
				</table>
				<br />
				<table cellpadding="10" cellspacing="0" width="100%" class="border">
				<tr><td class="title" align="left"><?php echo $lang['TOTAL_GENDER']; ?></td></tr>
				<tr>
					<td><center><?php displayGenderStats(); ?></center></td>
				</tr>
				</table>
				<br />
				<table cellpadding="10" cellspacing="0" width="100%" class="border">
				<tr><td class="title" align="left"><?php echo $lang['TOTAL_COUNTRY_STATS']; ?></td></tr>
				<tr>
					<td><center><?php displayCountryStats(); ?></center></td>
				</tr>
				</table>
				<br />
				<table cellpadding="10" cellspacing="0" width="100%" class="border">
				<tr><td class="title" align="left"><?php echo $lang['TOTAL_ONLINE_WHO']; ?></td></tr>
				<tr>
					<td><center><?php displayActiveUsers(); ?></center></td>
				</tr>
				</table>

				<br />
				<table cellpadding="10" cellspacing="0" width="100%" class="border">
				<tr><td class="title" align="left">Assistente Venus</td></tr>
				<tr>
					<td><center><img src="http://rbe-pod.net/images/hal.gif" width=100 align=center>
<BR> <iframe src="http://rbe-pod.net:2001?botid=Venus&template=chat"
 name="iframe1" frameborder="0" height="100%"
 scrolling="no" width="100%"></iframe></center></td>
				</tr>
				</table>

			</td>
		</tr>
		</table>
		</td>
	</tr>
	</table>
	</center>
<?php include("footer.php"); ?>
